import axios from 'axios'
import { Toast } from 'vant';

const http = axios.create({
    baseURL:`https://m.maizuo.com`,
    timeout:10000,
    headers:{
    'X-Client-Info': '{"a":"3000","ch":"1002","v":"5.2.0","e":"1642648622150680337645569"}',
    }
})
http.interceptors.request.use(function(config){
    Toast.loading({
        message: '加载中...',
        forbidClick: true,
        duration: 0
      })
    return config
},function(error){
    return Promise.reject(error)
})
http.interceptors.response.use(function(response){
    Toast.clear()
    return {
        ...response,
        // aaa:"zyx"
    }
},function(error){
    Toast.clear()
    return Promise.reject(error)
})
export default http